Vastly improve configuration error messages
authorAlex Crichton <alex@alexcrichton.com>
Wed, 14 Jan 2015 17:58:43 +0000 (09:58 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 16 Jan 2015 16:45:07 +0000 (08:45 -0800)
commita468236a4bfa8fa002bb96eb207c477fb0f23379
tree5b281775d74e6343d6be26d5877c2d3775ec6b35
parent5d0cb3f2e93e783248b1aa914a278e4ae0c86844
Vastly improve configuration error messages

This commit seeks to improve error messages with respect to a misconfigured
Cargo. This is done with a few principles and architectural changes:

* All error messages related to configuration should now mention the file in
  question.
* All error messages should print the key in question which was in error.
* Loading configuration values is now centralized in the `Config` structure,
  providing precisely one location where error message originate from. The
  messages were previously strewn and duplicated about.
* The `Config` structure now provides typed `get_foo` methods to load various
  configuration keys of various types.
src/cargo/ops/cargo_compile.rs
src/cargo/ops/cargo_new.rs
src/cargo/ops/registry.rs
src/cargo/util/config.rs
tests/test_bad_config.rs [new file with mode: 0644]
tests/test_cargo_compile.rs
tests/tests.rs